Agent Anatomy

What is an agent, really? One agent, four organs, switch one off and watch it break.

Foundation Track 02. The zoom-in on a single agent. An agent is not a model: it's a model wired to three more things. This repo makes that concrete with runnable code and an interactive toggle demo.

Open source github.com ↗
Track
Foundation 02 · The agent atom
Runtime
Node.js 18+ Zero dependencies Mock mode (offline)
The four organs
Brain (LLM) Hands (tools) Memory Loop
Repository

The one-liner

An agent = brain (LLM) + hands (tools) + memory + loop. Take any one away and it collapses into something simpler, usually a plain chatbot. This repo makes that concrete by running the same three-turn conversation with each combination of organs.

The four organs

  • Brain (the LLM). Always on, it's the reasoning engine. Alone, it can talk and think, but it forgets the moment you ask something new, can't do arithmetic (no tools), and answers only once (no loop). A brain alone is a chatbot.
  • Memory. Facts that survive across turns. Without it the agent is a goldfish: every conversation starts from zero. With it, “what is my name?” works. This tiny store is the entry-level version of a real memory engine, the production version (with persistence, recall ranking, and anti-drift) is a whole engine in AgentKernel.
  • Hands (tools). The ability to act on the world rather than just talk about it. Here the tool is a calculator; in production it could be a web search, a database write, an API call. Tools alone aren't enough, using a tool is a three-beat move (call → read result → respond) that requires the loop.
  • Loop. The organ that flips a chatbot into an agent. It lets the model call a tool, read what came back, decide what to do next, and only then answer. Remove the loop and the agent reaches for a tool and freezes, no matter how many tools you bolt on.

The ablations: break it on purpose

The fastest way to understand what an organ does is to remove it:

node ablations/no-memory.js   # forgets your name → continuity dies
node ablations/no-tools.js    # can only talk, can't act → agency dies
node ablations/no-loop.js     # freezes mid-tool-use → it's a chatbot

How to run it

# organs added one at a time
node parts/1-the-brain/demo.js
node parts/2-the-memory/demo.js
node parts/3-the-hands/demo.js
node parts/4-the-loop/demo.js

# the complete agent
node full-agent/agent.js

# real model (Ollama):
LLM_MOCK=0 node full-agent/agent.js

The GLOSSARY

GLOSSARY.md in the repo settles the words people use interchangeably: chatbot vs. assistant vs. agent vs. workflow vs. swarm. One test that cuts through all of it: “Does the system decide its own next step at runtime, and can it take more than one?” If yes → agent. If a human wrote the steps → workflow. If it answers once and stops → chatbot.

Where this fits

This is the zoom-in on rung 03 of AI Systems Evolution. Once you understand the atom, the team (rung 04) and swarm (rung 05) are just compositions of it. For five production-grade runnable agent systems built on these principles, see Agentic Systems.